Exercise 1: Global approach to image description

a) Myhist3

b) Compare histograms

c) Test comparison

Question: Which image (object_02_1.png or object_03_1.png) is more similar to image object_01_1.png considering the L2 distance? How about the other three distances? We can see that all three histograms contain a strongly expressed component (one bin has a much higher value than the others). Which color does this bin represent?

In all 4 measures object_03_1.png is more similar to object_01_1.png than object_02_1.png is.

The biggest bin of the histogram is the one containing black pixels.

d) Simple image retrieval system

e) Distance plot

f) frequency-based weighting technique

Exercise 2: Convolution

a) Compute convolution by hand

b) Implement the function simple_convolution

Question: Can you recognize the shape of the kernel? What is the sum of the elements in the kernel? How does the kernel affect the signal?

It is a Gaussian kernel. The sum of the elements in the kernel is almost 1. The kernel removes high frequency signals.

c) Better simple_convolution

d) Write a function that calculates a Gaussian kernel

$$ g(x) = \frac{1}{\sigma\sqrt{2\pi}}\exp{\left(-\frac{x^2}{2\sigma^2}\right)} $$

Question: The figure below shows two kernels (a) and (b) as well as signal (c). Sketch (do not focus on exact proportions of your drawing but rather on the understanding of what you are doing) the resulting convolved signal of the given input signal and each kernel. You can optionally also implement a convolution demo based on the signals and your convolution code, but the important part here is your understanding of the general idea of convolution.

e) associativity of operations

Exercise 3: Image filtering

A Gaussian filter in 2-D space

Question: Which noise is better removed using the Gaussian filter?

The gaussian noise

b) Convolution for image sharpening

c) Implement a nonlinear median filter

Question: Which filter performs better at this specific task? In comparison to Gaussian filter that can be applied multiple times in any order, does the order matter in case of median filter? What is the name of filters like this?

Median filter performs better at this task.

Gaussian filter is commutative but median filter is not (proven by counter example below).

d) Implement a 2-D version of the median filter

Question: What is the computational complexity of the Gaussian filter operation? How about the median filter? What does it depend on? Describe the computational complexity using the $O(·)$ notation (you can assume $n \log n$ complexity for sorting).

Gaussian filter: $O(wn^2)$ where $n$ is width and hight of the image and $w$ is sidth and height of the kernel \ Median filter: $O(n^2\cdot w^2 \log w^2)$ where $n$ is width and hight of the image and $w$ is sidth and height of the kernel

e) Implement the hybrid image approach